package ua.kiev.tosik.price.gui.models;

import org.apache.log4j.Logger;

import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;

abstract public class SimpleTableModel extends AbstractTableModel implements TableModel {

	protected String[] colNames;
	protected DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
	protected DateFormat dateTimeFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
	protected NumberFormat numberFormat = new DecimalFormat("#,###");
	protected static Logger logger = Logger.getLogger("ua.kiev.tosik.price.gui.models");

	public SimpleTableModel() {
		
	}

	public int getColumnCount() {
		return colNames.length;
	}

	@Override
	public String getColumnName(int column) {
		return colNames[column];
	}

	public void setColumnName(int column, String name) {
		colNames[column] = name;
	}

	@Override
	public boolean isCellEditable(int row, int col) {
		return false;
	}

	@Override
	public void setValueAt(Object aValue, int row, int column) {
		
	}

}
